package site.marqstree.kotlinmall.ui.fragment.home.discount

import android.widget.ImageView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import jp.shts.android.library.TriangleLabelView
import site.marqstree.kotlin.library.base.util.GlideUtil
import site.marqstree.kotlinmall.R


/*
 * 项目名: KotlinMall
 * 包名: site.marqstree.kotlinmall.ui.fragment.home.discount
 * 文件名: discountAdapter
 * 创建者: marqstree
 * 创建时间: 2020/2/29 10:54
 * 描述: TODO
 */
class DiscountAdapter(list: MutableList<DiscountData>):
    BaseQuickAdapter<DiscountData, BaseViewHolder>(R.layout.item_home_discount,list) {

    override fun convert(holder: BaseViewHolder, item: DiscountData) {
        val mRightLabelIv: ImageView = holder.getView(R.id.mRightLabelIv)
        GlideUtil.loadImage(context,
                            item?.image_url!!,
                            mRightLabelIv)
        val mRightLabelTlv: TriangleLabelView = holder.getView(R.id.mRightLabelTlv)
        mRightLabelTlv.setPrimaryText(item.label)
        holder.setText(R.id.mRightLabelTvTitle,item.text1)
        holder.setText(R.id.mRightLabelTvText,item.text2)
    }

}